package cn.yangliu.nacos.management.entity.sys;

import java.time.LocalDateTime;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import cn.yangliu.nacos.comm.constant.GlobalConstants;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * The type of nacos.
 *
 * @author 问道于盲
 * @date 2020 -01-04
 */
@Data
@Entity
@Table(name = "cm_operation")
public class Operation implements cn.yangliu.operation.entity.Operation<Long> {

    /**
     * current class instance's member.
     * The Id.
     */
    @ApiModelProperty(value = "id",example = "1")
    @Id
    @GeneratedValue
    private Long id;

    /**
     * current class instance's member.
     * The Remark.
     */
    @ApiModelProperty(value = "备注")
    private String remark;

    /**
     * current class instance's member.
     * The Operator id.
     */
    @ApiModelProperty(value = "操作人id")
    private String operatorId;

    /**
     * current class instance's member.
     * The Operator.
     */
    @ApiModelProperty(value = "操作人")
    private String operator;

    /**
     * current class instance's member.
     * The Host.
     */
    @ApiModelProperty(value = "客户端ip")
    private String host;

    /**
     * current class instance's member.
     * The Operate time.
     */
    @ApiModelProperty(value = "操作时间")
    @DateTimeFormat(pattern = GlobalConstants.DATETIME)
    @JsonFormat(pattern = GlobalConstants.DATETIME)
    private LocalDateTime operateTime;

    /**
     * current class instance's member.
     * The Module.
     */
    @ApiModelProperty(value = "操作模块")
    private String module;

    /**
     * current class instance's member.
     * The Action.
     */
    @ApiModelProperty(value = "操作行为")
    private String action;

    /**
     * current class instance's member.
     * The Operate status.
     */
    @ApiModelProperty(value = "操作结果")
    private boolean operateStatus;

    /**
     * current class instance's member.
     * The Operate level.
     */
    @ApiModelProperty(value = "行为等级")
    private String operateLevel;

    /**
     * current class instance's member.
     * The Server method.
     */
    @ApiModelProperty(value = "服务端执行方法")
    private String serverMethod;

    /**
     * current class instance's member.
     * The Params.
     */
    @ApiModelProperty(value = "提交关键参数")
    private String params;

    /**
     * current class instance's member.
     * The Application name.
     */
    @ApiModelProperty(value = "系统名称")
    private String applicationName;

    /**
     * current class method for getter.
     * Gets operate status.
     *
     * @return the operate status
     */
    @Override
    public boolean getOperateStatus() {
        return operateStatus;
    }

}
